package com.example.elasticsearchhepler.entity;

import com.example.elasticsearchhepler.annotations.ESField;
import com.example.elasticsearchhepler.enums.ESAnalyzerType;
import com.example.elasticsearchhepler.enums.ESFieldType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
public class CityInfoModel implements Serializable {

    private static final long serialVersionUID = 8106225120229697828L;

    @ESField(name = "status_list",type = ESFieldType.Integer)
    private List<Integer> statusList;

    @ESField(name = "post_code_list",type = ESFieldType.Keyword)
    private List<String> postCodeList;

    @ESField(name = "name",type = ESFieldType.Text,searchAnalyzer = ESAnalyzerType.IK_MAX_WORD,analyzer=ESAnalyzerType.IK_MAX_WORD)
    private String name;

    @ESField(name = "post_code",type = ESFieldType.Keyword)
    private String postCode;

    @ESField(name = "status",type = ESFieldType.Integer)
    private Integer status;

    @ESField(name = "area",type = ESFieldType.Nested,childType = AreaInfoModel.class)
    private AreaInfoModel area;

    @ESField(name = "area_list",type = ESFieldType.Nested,childType = AreaInfoModel.class)
    private List<AreaInfoModel> areaList;
}
